package com.capital.schedule;

import com.capital.service.CfnService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author qiwy
 * @version 1.0.0
 * @date 2022/04/26 14:00
 */
@Slf4j
@Component
@EnableScheduling
public class TimerTask {

    @Autowired
    private CfnService cfnService;

    /**
     * 凌晨1点
     */
    @Async("asyncServiceExecutor")
//    @Scheduled(cron = "0 0 1 * * ? ", zone ="GMT+8:00")
    @Scheduled(cron = "0/3 * * * * ? ", zone ="GMT+8:00")
    public void timerAddCfn() {
        cfnService.timerAddCfn();
    }

}
